﻿@page "/article/{code}"
@inherits BaseComponent

<PageTitle>@model?.Title - @AppConfig.AppTitle</PageTitle>

<div class="container cl-container cl-article">
	<CmsCard>
		<div class="view-count"><i class="far fa-eye" /> @model?.ViewQty</div>
		<div class="cl-article-body @Code">
			<UPostInfo Model="model" />
		</div>
	</CmsCard>
</div>

@code {
	private ISiteService Service;
	private PostDetailInfo model;

	[Parameter] public string Code { get; set; }

	protected override async Task OnInitAsync()
	{
		await base.OnInitAsync();
		Service = await CreateServiceAsync<ISiteService>();
		model = await Service.GetPostAsync(ContentType.Article, Code);
	}
}